package com.guessnumber.guess;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.inventory.Inventory;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;

public class gui implements CommandExecutor {
    public class log {
        int request;
        boolean res; // false : n < request  true n > request
        public log(int req,boolean res){
            this.request = req;
            this.res = res;
        }
    }
    public class info{
        int answer;
        int time;
        int up;
        int down;
        log[] logs = new log[14];
        void start(){
            answer = (int)(Math.random() * 100);
            time = 1;
            up = 99;
            down = 0;
        }
        void stop(boolean win){
            if (win) answer = 114514;
            else answer = -114514;
        }
        void guess(int req){
            if (answer < req){
                down = req;
                logs[time] = new log(req,false);
                time += 1;
            }
            else if (answer > req) {
                up = req;
                logs[time] = new log(req,true);
                time += 1;
            }
            else {
                stop(true);
                return;
            }
            if (time > 10){
                stop(false);
            }
        }
    }
    //ArrayList<Inventory> invs = new ArrayList<>();
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        return false;
    }
}
